#pragma once
#include "dbbase.h"

#define MAX_DRAFT 1024

class CDraftsDb :
    public CDbBase
{
public:
    CDraftsDb(void);
    ~CDraftsDb(void);

    DWORD Open(void);
    DWORD Add(CString Draft, UINT *pAssignedId);
    DWORD Get(UINT Index, UINT *pId, CString *pDraft);
    DWORD Set(UINT Index, CString Draft);
    DWORD GetFromId(UINT Id, CString *pDraft, UINT *pIndex);

private:
    struct Record
    {
        UINT Id;
        TCHAR Draft[MAX_DRAFT];
    };

    static const TCHAR *DB_NAME;

    UINT m_MaxId;
};
